package S10.first.tiaozhan;
//可以参考圆柱体类Cylinder、圆球体类Sphere的代码，完善立方体类Cube的代码
//要保证Test类的正常运行，显示格式参照运行示例
public class Cube implements Geometry { //立方体
	private double bian; //边长
	public Cube(double bian) {
		this.bian=bian;
	}
	@Override
	public double getArea() {
		return bian*bian*6;
	}
	@Override
	public double getVolume() {
		return bian*bian*bian;
	}
	@Override
	public String toString() {
		return String.format("立方体(边长：%.2f)的表面积为：%.2f，体积为：%.2f", bian, getArea(), getVolume());
	}


}
